package com.jk.mapper;

import com.jk.vo.AuthOrgInfo;
import com.jk.vo.WorkOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * Created by ${user} on ${data}.
 */
public interface AuthOrgInfoMapper {
    //企业证件身份查询
    @Select("SELECT t.org_id AS orgId ,t.org_type AS orgType, t.org_cates_number AS orgCatesNumber, t.org_name AS orgName ,\n" +
            "t.org_rest AS orgRest , t.org_area_id AS oegAreaId,t.org_place AS orgPlce, t.org_info AS orgInfo ,\n" +
            "t.org_term_time AS orgTermTime,l.user_id AS userId ,l.user_name AS userName,l.user_type AS userType,\n" +
            " l.user_status AS userStatus,l.registeTime AS registeTime,\n" +
            "l.user_email AS userEmail, t.exam_status AS examStatus,l.user_number AS userNumber \n" +
            "FROM auth_org_info t ,user_login l WHERE t.exam_status=1 AND t.user_id=l.user_Id")
    List<Map> SelectAuthOrgInfo(AuthOrgInfo authOrgInfo);
    //企业证件身份修改
    @Update("update auth_org_info  set exam_status=#{examStatus} where org_id=#{orgId}")
    int UpdateAuthOrgInfo(AuthOrgInfo authOrgInfo);
    //工单表新增
    @Insert("insert into work_order(workOder_id,workOder_no,workOder_dic,workOder_time,wmployee_id,user_id)VALUES(#{workoderId},#{workoderNo},#{workoderDic},#{workoderTime},#{wmployeeId},#{userId})")
    int InsertAuthOrgInfo(WorkOrder workOrder);
@Select("SELECT t.org_id AS orgId ,t.org_type AS orgType, t.org_cates_number AS orgCatesNumber, t.org_name AS orgName ,\n" +
        " t.org_rest AS orgRest , t.org_area_id AS oegAreaId,t.org_place AS orgPlce, t.org_info AS orgInfo , t.org_term_time AS orgTermTime,\n" +
        " t.exam_status AS examStatus FROM auth_org_info t  WHERE t.org_id=#{id}")
    AuthOrgInfo updateOrg(String id);
}
